Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eval): open the floating window under the cursor #332

Merged
merged 1 commit into from
Feb 17, 2024
Merged

fix(eval): open the floating window under the cursor #332

merged 1 commit into from
Feb 17, 2024

Conversation

toh995
Copy link
Contributor

@toh995 toh995 commented Feb 10, 2024

Fixes #316

Screenshot 2024-02-10 at 3 40 03 PM

Comment on lines -189 to -190
local line_no = async.fn.screenrow()
local col_no = async.fn.screencol()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

screenrow() and screencol() always seem to output 1.

See here: neovim/neovim#15754 (comment)

local win_pos = async.api.nvim_win_get_position(0)
local position = {
line = win_pos[1] + async.fn.winline(),
col = win_pos[2] + async.fn.wincol() - 1,
Copy link
Contributor Author

@toh995 toh995 Feb 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes an off-by-one error (0-indexing vs. 1-indexing)

@rcarriga
Copy link
Owner

Thanks for the PR! 😄

@rcarriga rcarriga merged commit 7a1878c into rcarriga:master Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nvim dap ui eval floating window position
2 participants